package com.njlime.cms.service.app;

import com.njlime.cms.entities.CommunityComment;
import com.njlime.cms.repository.app.AppCommunityCommentDao;
import com.njlime.core.helper.PageBean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service
public class AppCommunityCommentService {
    @Resource
    AppCommunityCommentDao appCommunityCommentDao;

    public Map<String, Object> get(int id) {
        return appCommunityCommentDao.get(id);
    }

    /**
     * 保存
     * @param communityComment
     */
    @Transactional(readOnly = false)
    public void save(CommunityComment communityComment){
        appCommunityCommentDao.save(communityComment);
    }

    /**
     * 列表
     * @param pageBean
     * @param comment
     * @return
     */
    public PageBean list(PageBean pageBean, CommunityComment comment) {
        return appCommunityCommentDao.list(pageBean, comment);
    }

    /**
     * 点赞数
     * @param id
     * @param num
     */
    public void fabulousNumUpdate(Integer id,int num){
        appCommunityCommentDao.fabulousNumUpdate(id,num);
    }

    /**
     * 奖励列表
     * @param pageBean
     * @param informationId
     * @return
     */
    public PageBean rewardList(PageBean pageBean, Integer informationId){
        return appCommunityCommentDao.rewardList(pageBean, informationId);
    }

}
